import { Channel } from '@/types/data'

const CHANNEL_KEY = 'geek-app-channel'
// 保存频道列表数据
export function setChannels (channels:Channel[]):void {
  localStorage.setItem(CHANNEL_KEY, JSON.stringify(channels))
}

// 获取频道列表数据
export function getChannels ():Channel[] {
  return JSON.parse(localStorage.getItem(CHANNEL_KEY) || '[]')
}
